$(function() {
	$(".tanc").hide();
});

var timeout_error = null;
var goToUrl_error = null;
function error(errorMsg, second, url) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#error-pop").fadeIn("fast");
	$("#error-pop").attr("url", url);
	$("#error-pop .hint").html(errorMsg);
	$("#error-pop").click(function() {
		if (timeout_error != null) {
			clearTimeout(timeout_error);
			$("#error-pop").fadeOut("fast");
			timeout_error = null;
		}
		if (goToUrl_error != null) {
			var goToUrl = $("#error-pop").attr("url");
			clearTimeout(goToUrl_error);
			top.location.href = goToUrl;
			goToUrl_error = null;
		}
	});
	if (url != null && url != "") {
		goToUrl_error = setTimeout("top.location.href='"+url+"'", second * 1000);
	}
	timeout_error = setTimeout('$("#error-pop").fadeOut("fast")', second * 1000);
}

var timeout_error = null;
var goToUrl_error = null;
function errorTimeUrl(errorMsg, second, url) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#error-pop").fadeIn("fast");
	$("#error-pop").attr("url", url);
	$("#error-pop .hint").html(errorMsg);
	$("#error-pop").click(function() {
		if (timeout_error != null) {
			clearTimeout(timeout_error);
			$("#error-pop").fadeOut("fast");
			timeout_error = null;
		}
		if (goToUrl_error != null) {
			var goToUrl = $("#error-pop").attr("url");
			clearTimeout(goToUrl_error);
			top.location.href = goToUrl;
			goToUrl_error = null;
		}
	});
	if (url != null && url != "") {
		goToUrl_error = setTimeout("top.location.href='"+url+"'", second * 1000);
	}
	timeout_error = setTimeout('$("#error-pop").fadeOut("fast")', second * 1000);
}
function errorTime(errorMsg, second) {
	$("#error-pop").fadeIn("fast");
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#error-pop .hint").html(errorMsg);
	$("#error-pop").click(function() {
		if (timeout_error != null) {
			clearTimeout(timeout_error);
			$("#error-pop").fadeOut("fast");
			timeout_error = null;
		}
	});
	timeout_error = setTimeout('$("#error-pop").fadeOut("fast")', second * 1000);
}
function error(errorMsg) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#error-pop").fadeIn("fast");
	$("#error-pop .hint").html(errorMsg);
	$("#error-pop").click(function() {
		$("#error-pop").fadeOut("fast");
	});
}

var timeout_success = null;
var goToUrl_success = null;
function successTimeUrl(errorMsg, second, url) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#success-pop").fadeIn("fast");
	$("#success-pop").attr("url", url);
	$("#success-pop .hint").html(errorMsg);
	$("#success-pop").click(function() {
		if (timeout_success != null) {
			clearTimeout(timeout_success);
			$("#success-pop").fadeOut("fast");
			timeout_success = null;
		}
		if (goToUrl_success != null) {
			var goToUrl = $("#success-pop").attr("url");
			clearTimeout(goToUrl_success);
			top.location.href = goToUrl;
			goToUrl_success = null;
		}
	});
	if (url != null && url != "") {
		goToUrl_success = setTimeout("top.location.href='"+url+"'", second * 1000);
	}
	timeout_success = setTimeout('$("#success-pop").fadeOut("fast")',
			second * 1000);
}
function successTime(errorMsg, second) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#success-pop").fadeIn("fast");
	$("#success-pop .hint").html(errorMsg);
	$("#success-pop").click(function() {
		if (timeout_success != null) {
			clearTimeout(timeout_success);
			$("#success-pop").fadeOut("fast");
			timeout_success = null;
		}
	});
	timeout_success = setTimeout('$("#success-pop").fadeOut("fast")',
			second * 1000);
}
function success(errorMsg) {
	if(errorMsg==null){
		errorMsg="操作失败，请稍后重试";
	}
	$("#success-pop").fadeIn("fast");
	$("#success-pop .hint").html(errorMsg);
	$("#success-pop").click(function() {
		$("#success-pop").fadeOut("fast");
	});
}

function showLoading(errorMsg) {
	if (errorMsg == null || errorMsg == "") {
		errorMsg = "请稍候，正在处理…";
	}
	$("#loding-pop").fadeIn("fast");
	$("#loding-pop .hint").html(errorMsg);
}

function hideLoading() {
	$("#loding-pop").fadeOut("fast");
	$("#loding-pop .hint").html("请稍候，正在处理…");
}
